{__NOLAYOUT__}
<layout name="no_nav" />

<style type="text/css">
.menu-list-item-adv:after {
	border:0px;
}
.menu-item-operate {
	padding-right: 0.8em;
	right:0px;
	position:absolute;
	height: 100%;
	display: -webkit-box;
	-webkit-box-orient: horizontal;
	-webkit-box-pack: center;
	-webkit-box-align: center;
	display: -moz-box;
	-moz-box-orient: horizontal;
	-moz-box-pack: center;
	-moz-box-align: center;
	display: -o-box;
	-o-box-orient: horizontal;
	-o-box-pack: center;
	-o-box-align: center;
	display: -ms-box;
	-ms-box-orient: horizontal;
	-ms-box-pack: center;
	-ms-box-align: center;
	display: box;
	box-orient: horizontal;
	box-pack: center;
	box-align: center;
}
</style>

<!-- TOPBAR -->
<header class="top-bar flex-row">
  <a class="row-item row-item-auto top-bar-back" href="{:U('DisShop/my', 'sid='.$sid)}">返回</a>
  <h3 class="row-item top-bar-name">个人中心</h3>
  <a class="row-item row-item-auto top-bar-menu" href="{$config.url}">主页</a>
</header>

<!-- 头像 -->
<section class="my-head">
  <figure class="my-head-content">
    <p class="my-head-img">
      <img id="head" src="{$user.face}" alt="" style="border-radius: 50%;">
      <input id="upload-head" class="my-header-file-input" type="file" accept="image/*">
    </p>
    <p class="my-head-name">{$user.nickname}</p>
  </figure>
</section>

<section class="my-list menu-list">
  <a class="menu-list-item" href="javascript:void(0);">
    <div class="menu-list-inner">
      <p class="menu-list-title">总积分({$user.bonus})</p>
    </div>
  </a>
  <a class="menu-list-item" href="javascript:void(0);">
    <div class="menu-list-inner">
      <p class="menu-list-title">已提积分({$user.mention})</p>
    </div>
  </a>
  <a class="menu-list-item menu-list-item-adv" href="javascript:void(0);">
    <div class="menu-list-inner">
      <p class="menu-list-title">剩余积分({$user['bonus'] - $user['mention'] - $user['engagedInMoney']|number_format=2})</p>
    </div>
	<div class="menu-item-operate">
    	<button class="btn btn-orange" id="btnWithDraw2">购买商品</button>
    </div>
  </a>
  <a class="menu-list-item menu-list-item-adv" href="javascript:return false;">
    <div class="menu-list-inner">
      <p class="menu-list-title">可提积分({$user['withdrawable'] | number_format=2})</p>
    </div>
    <div class="menu-item-operate">
    	<button class="btn btn-orange" id="btnWithDraw">提现</button>
    </div>
  </a>
</section>

<section class="my-list menu-list">
  <a class="menu-list-item" href="{:U('DisShop/withdrawRecord', 'sid='.$sid)}">
    <div class="menu-list-inner">
      <p class="menu-list-title">提现记录</p>
    </div>
  </a>
</section>

<script type="text/javascript">
$("#btnWithDraw").click(function(e) {
	e.preventDefault();
	location.href="__CONTROLLER__/withdraw/sid/{$sid}";
});
</script>
<script type="text/javascript">
$("#btnWithDraw2").click(function(e) {
	e.preventDefault();
	location.href="__CONTROLLER__/index/sid/{$sid}";
});
</script>